#include <stdio.h>
#include <stdbool.h>
#include <stdlib.h>

typedef int ElemType;
typedef struct Node{
	ElemType data;
	struct Node *next;	
}Node;
typedef Node *LinkList;

//入参为指向指针的指针
void HeadInsert(LinkList *list, ElemType data){
	LinkList node = (LinkList)malloc(sizeof(struct Node));
	node->data = data;
	node->next = NULL;
	if(*list != NULL){
		node->next = *list;
	}
	*list = node;
}

void PrintList(LinkList L){
	printf("%p\n", L);
	LinkList p;
	p = L;
	while(p){
		printf("%d ", p->data);
		p=p->next;
	}
	printf("\n");
}

void Modify(int *a){
	*a = 100;
}

int main(){
	LinkList tmp = NULL;
	HeadInsert(&tmp, 10);
	HeadInsert(&tmp, 11);
	PrintList(tmp);
	return 0;
}
